package com.laivi.basic.model.file.export;

import java.util.List;

import com.laivi.basic.model.datastruct.ValueMap;
import com.laivi.basic.model.file.writer.CsvWriter;

public class CsvExport implements IExport {
	private String path;
	private List<ValueMap> datas;
	private CsvWriter writer;

	public CsvExport() {
		super();
	}

	public CsvExport(String path, List<ValueMap> datas) {
		super();
		this.path = path;
		this.datas = datas;
	}
	
	@Override
	public void export() {
		writer=new CsvWriter(path);
		writer.writeMap(datas);
	}

	@Override
	public void export(String[] titles, String[] fields) {
		writer=new CsvWriter(path);
		writer.writeMap(datas,titles,fields);
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public List<ValueMap> getDatas() {
		return datas;
	}

	public void setDatas(List<ValueMap> datas) {
		this.datas = datas;
	}

	

}
